package com.hx.test.security.config.mvc;

import com.hx.test.security.config.security.WebSecurityConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * ApplicationInitializer SPI mechanism
 * ensure that WebSecurityConfig was loaded in our existing ApplicationInitializer
 *
 * @author 华云龙
 * @date 2019-5-16
 */
public class MvcWebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    /**
     * make sure WebSecurityConfig.class is existing
     * @return
     */
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{WebSecurityConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[0];
    }

    @Override
    protected String[] getServletMappings() {
        return new String[0];
    }
}
